7. What should you do when you discover design flaws in construction?
8. What is aggregation?
9. What responsibility does a composite object have?
10. Briefly explain containment.
Exercises
1. Open a new Standard Visual Basic project. Use the Class Builder utility to create the following interface class:
Class:
ITelevision
Methods:
Public Function turnOn()
Public Function turnOff()
Public Function incrementChannel()
Public Function decrementChannel()
Public Function displayMenu()
Attributes:
CurrentChannel As String
BrandName As String
ModelName As String
Now create a class that implements ITelevision.
2. Using exercise 1, try to discover new methods and properties to add to the interface. How would those changes affect the other class that already implemented that interface?
3. Review the code in Listing 5.1. List some ways you would improve the public methods and properties of the classes.